<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('离职申请新增及修改')" />
	<th:block th:include="include :: businessCSS" />
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	<form class="layui-form head-form">
	    <div class="north">
       		<th:block th:include="include :: business_btn" />
	        <th:block th:include="include :: business_tpl('top')" />
    	</div>
	    <div class="mid-content">
	        <table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
	    </div>
	    <th:block th:include="include :: pageFooter" /> 
        </form>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<th:block th:include="include :: businessTableBtn" />
<th:block th:include="include :: inlineJS" />
<script type="text/javascript">
var $,layer,form,laydate,element;//定义layui模块
var nid = $("#nid").val(),noTable;//定义全局参数
layui.use(['laydate','form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,laydate = layui.laydate,util = layui.util,element=layui.element;
 	beforeInit();//表单初始化之前的动作集合
 	layui.element.render();
 	$.get("/hr/personnellzsq/listbynid?nid="+nid,function(res){
 		noTable=res.data;
	});
})
function tpBtnChange(type){
	layer.open({
		type: 1, 
		fix: false,//不固定
		offset: '10%',//距离顶部
		maxmin: true,//最大最小化
		shade: 0.3,//遮罩
		area: ['383px', '368px'],
		title: type==1?'上级意见':'总监意见',
		content: '<textarea id="textareaVal" style="width:100%;height:100%;background:#e2eff9;border:0;"></textarea>',
		btn: ['保存', '取消'],
		success: function(layero,index){
			layero.find('.layui-layer-content').css('overflow','unset');
			$("#textareaVal").val(type==1?$("#vSjYj").val():$("#vZjYj").val());
		},
		yes: function(index, layero){
			$(type==1?'#vSjYj':'#vZjYj').text($("#textareaVal").val());
			var pd=[];
			$.each(noTable,function(i,v){
				if(type==1)pd.push({"guid":v.guid,"vSjYj":$("#textareaVal").val()});
				else pd.push({"guid":v.guid,"vZjYj":$("#textareaVal").val()});
			})
			$.operate.post(moduleUrl+'/xgyjpost', {'infoItems':JSON.stringify(pd)}, function(res){
		        if(res.code == 0)layer.close(index);
		    })
		}
	});
}
</script>
</body>
</html>